@import "base.less";

/* 京东红*/

@jdred: #c91523;

/* 封装jd精灵图 */

.jdSprites() {
    background-image: url("../images/jd-sprites.png");
    background-size: 200px 200px;
}


/* 头部搜索 */

header {
    height: 40px;
    background-color: @jdred;
    padding: 5px 50px 5px 70px;
    position: fixed;
    width: 100%;
    z-index: 2;
    a {
        position: absolute;
        top: 0;
    }
    .logo {
        left: 0;
        .jdSprites();
        background-position: 0 -110px;
        width: 70px;
        padding: 10px;
        padding-left: 5px;
        background-origin: content-box;
        background-clip: content-box;
    }
    .login {
        width: 50px;
        right: 0;
        color: #fff;
        font-size: 16px;
        line-height: 40px;
        text-align: center;
    }
    .search {
        height: 100%;
        border-radius: 15px;
        overflow: hidden;
        position: relative;
        &:after {
            display: block;
            content: "";
            position: absolute;
            .jdSprites();
            background-position: -60px -110px;
            width: 20px;
            height: 20px;
            top: 7px;
            left: 10px;
        }
        input {
            text-indent: 30px;
        }
    }
}


/*  轮播 */

.carousel {
    overflow: hidden;
    position: relative;
    .carousel_ul {
        width: 1000%;
        /* 禁用浏览器默认 触摸行为 */
        touch-action: none;
        li {
            float: left;
            width: 10%;
        }
    }
    .carousel_index {
        position: absolute;
        bottom: 5px;
        /* left 相对于定位了的父元素 */
        left: 50%;
        /* 相对于自身的宽度 */
        transform: translateX(-50%);
        li {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            border: 1px solid #fff;
            float: left;
            margin-left: 5px;
        }
        .active {
            background-color: #fff;
        }
    }
}


/* 首页导航  */

.nav {
    ul {
        li {
            width: 25%;
            float: left;
            text-align: center;
            font-size: 14px;
            color: #666;
            a {
                padding: 5px;
                img {
                    width: 50%;
                    margin: 0 auto;
                }
                p {}
            }
        }
    }
}


/* 分割线 */

.line {
    height: 10px;
    background-color: #f5f5f5;
}


/*  掌上秒杀  */

.hand_kill {
    .kill_title {
        position: relative;
        .clock {
            .jdSprites();
            background-position: -85px -110px;
            position: absolute;
            width: 18px;
            height: 22px;
            left: 20px;
        }
        .kill_font {
            margin-left: 50px;
            color: @jdred;
        }
        .timer {
            position: absolute;
            top: 3px;
            left: 127px;
            font-size: 0;
            span {
                font-size: 16px;
                background-color: #3d3d3d;
                color: #fff;
                margin-left: 3px;
                padding: 0 2px;
            }
            span:nth-child(3n) {
                background-color: #fff;
                color: #3d3d3d;
            }
        }
        .kill_more {
            position: absolute;
            top: 3px;
            right: 0;
            width: initial;
            font-size: 14px;
        }
    }
    .kill_content {
        ul {
            li {
                float: left;
                /* 在less里面 可直接写数学表达式 */
                width: 100%/3;
                a {
                    position: relative;
                    text-align: center;
                    img {
                        width: 90%;
                        margin-top: 15px;
                    }
                    .kill_tip {
                        background-color: #fdb60a;
                        color: #fff;
                        position: absolute;
                        top: 80px;
                        font-size: 14px;
                        border-radius: 50%;
                        width: 46px;
                        height: 28px;
                        line-height: 28px;
                    }
                    .new_price {
                        font-size: 14px;
                        color: @jdred;
                    }
                    .old_price {
                        font-size: 14px;
                        color: #666;
                    }
                }
            }
        }
    }
}


/* 广告 */

.banner {
    padding: 5px;
}


/* 618节日 */

.festival {
    .festival_title {
        position: relative;
        ul {
            position: absolute;
            bottom: 5px;
            li {
                float: left;
                width: 50%;
                a {
                    img {
                        width: 95%;
                        margin: 0 auto;
                    }
                }
            }
        }
    }
    .festival_content {
        ul {
            li {
                float: left;
                width: 50%;
            }
            li:nth-child(-n+3) {
                width: 100%/3;
            }
        }
    }
}


/* 商品标题 */

.goods_title {
    color: @jdred; // padding-left: 5px;
    padding: 3px 5px;
}


/* 特色超市 */

.market {
    .market_content {
        ul {
            li {
                float: left;
                width: 50%;
            }
            li:nth-child(4) {
                clear: both;
            }
        }
    }
}


/*  主题街 */

.theme {
    .theme_content {
        ul {
            li {
                float: left;
                width: 25%;
            }
            li:nth-child(-n+2) {
                width: 50%;
            }
            li:nth-child(5) {
                clear: both;
            }
        }
    }
}


/* 品牌推荐 */

.recommend {
    .recommend_content {
        ul {
            li {
                float: left;
                width: 30%;
            }
            li:first-child {
                width: 40%;
            }
        }
    }
}


/* 猜你喜欢 */

.guess {
    .guess_title {
        .goods_title {
            a {
                float: right;
                display: inline;
                width: initial;
                font-size: 13px;
                font-weight: 400;
                img {
                    display: inline;
                    width: 18px;
                    vertical-align: middle;
                }
            }
        }
    }
    .guess_content {
        li {
            width: 50%;
            float: left;
            padding: 10px 10px 0;
            .gc_top {
                >span {
                    color: @jdred;
                }
                >a {
                    display: inline;
                    width: initial;
                    float: right;
                    font-size: 13px;
                    border: 1px solid #ccc;
                    color: #666;
                }
            }
            .gc_body {
                a {
                    border-bottom: 1px solid #ccc;
                }
                p {
                    font-size: 14px;
                    height: 37px;
                    overflow: hidden;
                }
            }
        }
    }
}


/* 点击更多 */

.more {
    background-color: #f3f5f7;
    color: #666;
    font-size: 14px;
    text-align: center;
    height: 40px;
    line-height: 40px;
    margin-top: 5px;
    border-top: 1px solid #ccc;
}


/* 底部工具栏 */

.footer_toolbar {
    background-color: #f3f5f7;
    .direct {
        padding: 10px;
        color: #666;
        border-top: 1px solid #ccc;
        font-size: 14px;
        a {
            width: 25%;
            float: left;
            text-align: center;
            border-right: 1px solid #000;
        }
        a:last-child {
            border: none;
        }
    }
    .app_icon {
        padding: 10px;
        border-top: 1px solid #ccc;
        a {
            width: 100%/3;
            float: left;
            text-align: center;
            font-size: 14px;
            color: #666;
            span {
                .jdSprites();
                width: 33px;
                height: 33px;
                display: inline-block;
            }
        }
        .app {
            span {
                background-position: -120px -70px;
            }
        }
        .touch {
            span {
                background-position: -40px -70px;
            }
        }
        .pc {
            span {
                background-position: -80px -70px;
            }
        }
    }
    .copyright {
        border-top: 1px solid #ccc;
        text-align: center;
        color: #666;
        font-size: 14px;
        padding: 20px;
    }
}


/* 底部菜单 */


footer {
    position: fixed;
    width: 100%;
    bottom: 0;
    a {
        float: left;
        width: 20%;
    }
}

.hiden {
    visibility: hidden;
    img {
        width: 20%;
    }
}